home *** CD-ROM | disk | FTP | other *** search
/ Merciful 2 / Merciful - Disc 2.iso / software / d / dialupv3.06.lha / dialup / dialup.h < prev    next >
C/C++ Source or Header  |  1996-01-30  |  3KB  |  145 lines

  1. /*
  2. Failat 1
  3. SC MAKEGST dialup.gst NOLINK dialup.h
  4. QUIT $RC
  5. */
  6.  
  7. #include <exec/types.h>
  8. #include <exec/memory.h>
  9. #include <exec/libraries.h>
  10. #include <exec/devices.h>
  11. #include <dos/dos.h>
  12. #include <devices/serial.h>
  13. #include <devices/timer.h>
  14. #include <devices/sana2.h>
  15. #include <exec/errors.h>
  16. #include <intuition/intuition.h>
  17. /* #include <usesysbase.h> */
  18. /* delete this line or put ' */
  19. #define __USE_SYSBASE
  20. /* ' in this file, it's neccessary if you do a GST */
  21. /* MGST ignores any #defines and declarations in the .c file since it is precompiling your HEADER FILES. */
  22. /* Library Reference Manual, Chapter 4, Page 30 */
  23. #include <proto/exec.h>
  24. #include <proto/dos.h>
  25. #include <proto/intuition.h>
  26. #include <stdio.h>
  27. #include <stdarg.h>
  28. #include <string.h>
  29. #include <math.h>
  30.  
  31. struct SP
  32. {
  33.     UBYTE    serDevName[100];
  34.     ULONG    serUnit;
  35.     ULONG    serBaudRate;
  36.     BOOL    listen2CD;
  37.     BOOL    serHWHS;
  38. };
  39.  
  40. struct argspec
  41. {
  42.     const UBYTE        *name;
  43.     LONG            deflt;
  44. };
  45.  
  46. enum argnames
  47. {
  48.     A_CMD,
  49.     A_PN,
  50.     A_RDD,
  51.     A_MCT,
  52.     A_RGS,
  53.     A_WBW,
  54.     A_WUS,
  55.     A_LIP,
  56.     A_LTO,
  57.     A_LIN,
  58.     A_PWP,
  59.     A_PW,
  60.     A_SLIP,
  61.     A_SLIN,
  62.     A_SPWP,
  63.     A_SPW,
  64.     A_LOK,
  65.     A_LOT,
  66.     A_VERBOSE,
  67.     A_TEST,
  68.     A_NSI,
  69.     A_NDI,
  70.     A_RPF,
  71.     A_QUIET,
  72.     A_STE,
  73.     A_AA,
  74.     A_NRC,
  75.     A_SAD,
  76.     A_SAU,
  77.     A_SCF,
  78.     A_CS,
  79.     A_MSC,
  80.     A_MSH,
  81.     A_MQC,
  82.     A_MRC,
  83.     A_MHC,
  84.     A_MOK,
  85.     A_MNC,
  86.     A_MLB,
  87.     A_MLD,
  88.     A_MRG,
  89.     A_MAC,
  90.     A_MAAC,
  91.     A_MOC,
  92.     A_MLC,
  93.     A_MTC,
  94.     A_MTO,
  95.     A_MOH,
  96.     A_ALL,
  97.     A_END
  98. };
  99.  
  100. #define WS(string) (string), sizeof(string)
  101. #define ABBREV(arg, key)                ( !strnicmp( ( arg ), ( key ), strlen( key ) ) )
  102. #define CUP(msgstr, res)        {msg(msgstr);                    result = (res); goto cleanup;}
  103. #define CUP1(msgstr, arg1, res)        {msg((msgstr), (arg1));            result = (res); goto cleanup;}
  104. #define CUP2(msgstr, arg1, arg2, res)    {msg((msgstr), (arg1), (arg2)); result = (res); goto cleanup;}
  105. #define MAXMATCHSTRING 10
  106. #define VARBUFSIZE 3000
  107. #define TEMPLATESIZE 1000
  108. #define RXBUFSIZE 10000
  109. #define SERPORTNAME "TheOneAndOnlySLIPPort"
  110. #define BREAKSTR "\n*BREAK*\n"
  111. #define VERIFY(fr) { if ( !(fr) ) return(FALSE); }
  112. #define _OK_ {return(TRUE);}
  113. #define _FAIL_ {return(FALSE);}
  114. #define loop for(;;)
  115.  
  116. BOOL    query(UBYTE *varbuf);
  117. BOOL    hangup(UBYTE *varbuf);
  118. BOOL    connect(UBYTE *varbuf);
  119. BOOL    take(UBYTE *varbuf);
  120. BOOL    commandmode(UBYTE *varbuf);
  121. BOOL    dropline(UBYTE *varbuf);
  122. BOOL    carrier(void);
  123. BOOL    checkconnect(UBYTE *buf);
  124. BOOL    unique(struct MsgPort *serport);
  125. void    initDefaultsAndTemplate(UBYTE *);
  126. BOOL    initDefaultsTemplate(UBYTE *, LONG argd[]);
  127. void    showdefaults(LONG argd[]);
  128. BOOL    initSerialLine(struct SP *serpara);
  129. void    buildMatchStringArray( UBYTE *pattern, UBYTE *buf, UBYTE *msa[] );
  130. UBYTE * matchString( UBYTE *string, UBYTE *msa[]);
  131. UBYTE *    sStrMatch(UBYTE *string, UBYTE *pattern, UBYTE *buf);
  132. BOOL    sendLine( UBYTE *send );
  133. BOOL    sendToSer( UBYTE *send );
  134. BOOL    wuSend( UBYTE *send );   /* taylor made for the WAKEUPSTRING -GH- */
  135. BOOL    sendWUSSer( UBYTE *send ); /* more taylormade stuffs -GH- */
  136. BOOL    kickport( UBYTE *send ); /* more of them -GH- */
  137. UBYTE *    expectFromSer( UBYTE *expect, USHORT timeout );
  138. UBYTE *    exSend(    UBYTE *expect, USHORT timeout, UBYTE  *send );
  139. UBYTE *    sendEx(    UBYTE *send,   UBYTE  *expect, USHORT timeout );
  140. void    adjustdefs(void);
  141.  
  142. BOOL    ReadConfig(STRPTR sanacfgfile, USHORT sanaUnit, struct SP *sp);
  143. VOID    msg(UBYTE *msgstr, ...);
  144. VOID    kprintf(UBYTE *msgstr, ...);
  145.